Database Languages

A database system provides
a data definition language to specify the database schema
a data manipulation language to express database queries and updates.

In practice, the data definition and data manipulation languages are not two separate languages; instead they simply form parts of a single database language, such as the widely used SQL language.

Data Definition Language:
  1. Database schema is specified by a set of efinitions expressed by a special language called a data-definition language (DDL).
  1. For instance, the following statement in the SQL language defines the account table:

 

create table account (account-number char(10), balance integer)

 

  1. Execution of the above DDL statement creates the account table. In addition, it updates a special set of tables called the data dictionary or data directory.

 

  1. A data dictionary contains metadata—that is, data about data. The schema of a table is an example of metadata. A database system consults the data dictionary before reading or modifying actual data.

 

  1. The data values stored in the database must satisfy certain consistency constraints. For example, suppose the balance on an account should not fall below $100.

 

  1. The DDL provides facilities to specify such constraints. The database systems check these constraints every time the database is updated
Data Manipulation Language:

Data manipulation is

  1. The retrieval of information stored in the database
  2. The insertion of new information into the database
  3. The deletion of information from the database
  4. The modification of information stored in the database

 

A data-manipulation language (DML) is a language that enables users to access or manipulate data as organized by the appropriate data model. There are basically two types:

 

  1. Procedural DMLs require a user to specify what data are needed and how to get those data.
  2. Declarative DMLs (also referred to as nonprocedural DMLs) require a user to

specify what data are needed without specifying how to get those data.

  1. A query is a statement requesting the retrieval of information. The portion of a DML that involves information retrieval is called a query language.

 

  1. There are a number of database query languages in use, either commercially or experimentally.
  2. The levels of abstraction apply not only to defining or structuring data, but also to manipulating data. At the physical level, we must define algorithms that allow efficient access to data.
  3. At higher levels of abstraction, we emphasize ease of use. The goal is to allow humans to interact efficiently with the system.
  4. The query processor component of the database system translates DML queries into sequences of actions at the physical level of the database system.

 

 

DBMS & SQl by P. Muthulakshmi & v. vanthana